/* 
描述：QuestionServiceImpl类实现了问题服务的业务逻辑，负责处理问答社区中问题的增删改查操作，
以及问题标签关联管理，是问答社区核心功能的服务实现。
完成人：吴悠 
完成时间: 2025/04/27
*/
package com.jiesenhe.qacommunity.service.impl;

import com.jiesenhe.qacommunity.mapper.QuestionMapper;
import com.jiesenhe.qacommunity.pojo.Comment;
import com.jiesenhe.qacommunity.pojo.Question;
import com.jiesenhe.qacommunity.pojo.QuestionTag;
import com.jiesenhe.qacommunity.pojo.Tag;
import com.jiesenhe.qacommunity.service.QuestionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class QuestionServiceImpl implements QuestionService {
    @Autowired
    QuestionMapper questionMapper;
    @Override
    public List<Question> getQuestionList(Question question) {
        return questionMapper.getQuestionList(question);
    }

    @Override
    public int insertQuestion(Question question) {
        return questionMapper.insertQuestion(question);
    }

    @Override
    public int insertQuestionTag(QuestionTag questionTag) {
        return questionMapper.insertQuestionTag(questionTag);
    }

    @Override
    public List<Tag> getQuestionTag(int questionId) {
        return  questionMapper.getQuestionTag(questionId);
    }
    @Override
    public List<Comment> getQuestionComment(int questionId) {
        return questionMapper.getQuestionComment(questionId);
    }
    @Override
    public int deleteQuestion(Question question) {
        return questionMapper.deleteQuestion(question);
    }

    @Override
    public int deleteQuestionCommentLike(Question question) {
        return questionMapper.deleteQuestionCommentLike(question);
    }

    @Override
    public int deleteQuestionLike(Question question) {
        return questionMapper.deleteQuestionLike(question);
    }

    @Override
    public int getLastQuestionId() {
        return questionMapper.getLastQuestionId();
    }


}
